<?php
#品牌等级初始化
ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';
ini_set('memory_limit', '1024M');

use Biz\model\brand\Brand as mBrand;

$page = 1;
$pageSize = 100;

do {
    $limit = [($page - 1) * $pageSize, $pageSize];
    $brandList = mBrand::selectByWhere([
        'uid[>]' => 0,
        'status' => mBrand::STATUS_USING,
        'brand_type' => [
            mBrand::BRAND_TYPE_COMMON,
            mBrand::BRAND_TYPE_BEST,
            mBrand::BRAND_TYPE_SUPER,
        ],
        'pack_type[>]' => 0,
        'LIMIT' => $limit,
        'ORDER' => ['id' => 'ASC']
    ],
        ['id', 'uid']
    );
    if ($brandList) {
        foreach ($brandList as $brand) {
            echo "brandId:{$brand['id']} uid:{$brand['uid']}" . PHP_EOL;
            \Biz\service\brand\BrandGrowth::primaryTaskDone($brand['uid'], $brand['id']);
        }
    }
    $page++;
} while ($brandList);
